package api

import (
	"github.com/gin-gonic/gin"
	jwt "github.com/golangblogs/gojwt"
	"yk3.19/api/handler"
)

func Router(r *gin.Engine) {
	api := r.Group("/api")
	{
		user := api.Group("/user")
		{
			user.POST("/up", handler.UserUp)
		}
		chat := api.Group("/chat")
		{
			chat.Use(jwt.JWTAuth("2210y"))
			chat.GET("/chat", handler.Chat)
		}
		video := api.Group("/video")
		{

			video.Use(jwt.JWTAuth("2210y"))
			video.POST("/add", handler.VideoAdd)
			video.GET("/list", handler.VideoList)
			video.POST("/findVideo", handler.VideoFindVideo)
			video.POST("/info", handler.VideoInfo)
		}
		bullet := api.Group("/bullet")
		{
			bullet.Use(jwt.JWTAuth("2210y"))
			bullet.POST("/add", handler.BulletAdd)
		}
	}
}
